#include "TimerTask.h"

TimerTask::TimerTask(std::string name, uint32_t timeout, const TaskFunc &cb)
    : name_(name), timeout_(timeout), taskCallback_(cb)
{
}

TimerTask::~TimerTask()
{
    if(canceled_==false)
    {
        //如果任务没被取消，则执行
        taskCallback_();
    }

    release_();
}
